<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>显示层级</title>
</head>
<style>
    div {
        height: 200px;
        width: 100px;
        /* z-index在父级显示时比较子级的距离比
        谁的位置在最后谁浮动在最上面 */
        /* 同时z-index要配合定位使用 */
        z-index: 6;
    }
    .one {
        background-color: lightblue;
        position: absolute;
        left: 20px;
        top: 50px;
        /* z-index在同级中谁的数值
        （只能取整数）大显示谁显示在最上面 */
        /* z-index: 3; */
    }
    .two {
        left: 40px;
        top: 100px;
        position: absolute;
        background-color: pink;
        /* z-index: 2; */
    }
    .three {
        position: absolute;
        background-color: #ccc;
        left: 80px;
    }
</style>
<body>
    <div class="one">one</div>
    <div class="two">two</div>
    <div class="three">three</div>
</body>
</html>